Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added x500_lidar model #3296

Merged
merged 6 commits into from
Jul 31, 2024
Merged

added x500_lidar model #3296

merged 6 commits into from
Jul 31, 2024

Conversation

Claudio-Chies
Copy link
Contributor

@Claudio-Chies Claudio-Chies commented Jul 17, 2024

@@ -52,6 +52,16 @@ The camera cannot yet be used to stream video or for image capture in QGroundCon
[PX4-Autopilot#22563](https://github.com/PX4/PX4-Autopilot/issues/22563) can be used to track the additional work needed to fully enable these use cases.
:::

### X500 Quadrotor with 2D LIDAR

This model have a 2D LIDAR attached, modelled on the Hokuyo TM-30LX.
Copy link
Collaborator

@hamishwillee hamishwillee Jul 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This all looks excellent. A few follow ons:

  1. did you mean UTM-30LX - google didn't find anything at all on TM-30LX.
  2. Is this a lidar that we support in PX4? I can't find it here: https://docs.px4.io/main/en/sensor/rangefinders.html#distance-sensors-rangefinders
  • though perhaps lidars should be in a different section?
  1. Also in that doc we have Gazebo Classic simulation section - https://docs.px4.io/main/en/sensor/rangefinders.html#gazebo-classic-simulation - Would it be possible for you to add a few words about simulation with Gazebo in its own section? (assuming this is the right place)?
  2. We should certainly update https://docs.px4.io/main/en/computer_vision/collision_prevention.html#px4-distance-sensor right?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PS You'll note there are more images in this PR than you had. I shrank all images linked in this folder (losslessly) so they just happen to appear as part of this.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. yea, youre right. thats a copypasta error.
  2. not that i can see. the only similar one we support is the Lightware SF45/B then it might make sense to remove the specific model. not sure of the best practices here.
  3. currently the rotating Lightware lidar is also in this section, but we could add a subsection...
  4. i agree that it would make sense to add a gazebo section to rangefinders, but i'm not sure if i'm the right person, as i have limited expierience creating my own models.
  5. see (2.)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @chfriedrich98

  1. not that i can see. the only similar one we support is the Lightware SF45/B then it might make sense to remove the specific model. not sure of the best practices here.
  2. currently the rotating Lightware lidar is also in this section, but we could add a subsection...

For now we leave both of these as is - can't do any harm and I'm not sure we'd be improving things.

I've added comments for 4 and 5 in other places - mostly for you to help me understand "what can we do now we have this model".

Comment on lines 164 to 174
## Gazebo Simulation

Lidar rangefinders can be used in the [Gazebo](../sim_gazebo_gz/index.md) simulator.
To do this you must start the simulator using a vehicle model that includes the rangefinder.

The x500 lidar model includes a 2D Lidar rangefinder:

```sh
make px4_sitl gz_x500_lidar
```

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Also in that doc we have Gazebo Classic simulation section - https://docs.px4.io/main/en/sensor/rangefinders.html#gazebo-classic-simulation - Would it be possible for you to add a few words about simulation with Gazebo in its own section? (assuming this is the right place)?

i agree that it would make sense to add a gazebo section to rangefinders, but i'm not sure if i'm the right person, as i have limited expierience creating my own models.

So what I was really trying to get at here was "OK, cool, we have a simulated vehicle with a rangefinder, what can I do with it? how can I use it?

My assumption is that if I use this model PX4 will be getting rangefinder data as though there were a real rangefinder attached to the vehicle and already enabled.

On that assumption I have added this section. So basically someone else reading this doc this will assume that they can just use this lidar. Do you happen to know what range it is set up to use? Or how this can be configured?

If that is not true, then we need to know how to make it useful.

It would be good to explain how to add this same model to other simulated frames, but that is not be as important.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, the only thing there is that the x500_lidar model generates a gazebo laserscan which gets translated into a obstacle distance message. not sure if this is the most representative example for rangefinder simulation... its more a collision prevention example. do we want to differentiate there?
i did add some specs on the simulated sensor. but these are hardcoded in the gazebo model. so no way to change them via parameters.

Copy link

No flaws found

Copy link
Collaborator

@hamishwillee hamishwillee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @Claudio-Chies ! Looking at the code, Gazebo does not support normal rangefinder use cases because it doesn't write to DistanceSensor (at all). It would be great if this model did so, because then you could use it for both collision prevention and other terrain following/position hold etc.

For now though I have made it explicit that the model is intended for collision prevention, and in the Rangefinder doc noted that currently these use cases are not supported. I kept the section though because I hope that you or someone else will update this or some other model to work as a rangefinder.

Thanks very much for this.

@hamishwillee hamishwillee merged commit ba6b8c8 into main Jul 31, 2024
2 checks passed
@hamishwillee hamishwillee deleted the pr-vision branch July 31, 2024 00:06

Next, adjust the relevant parameters to the appropriate values and add arbitrary obstacles to your simulation world to test the collision prevention functionality.

The diagram below shows how the simulation looks when viewed in RViz.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually its Gazebo and not RViz 😅

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @Claudio-Chies, I'll fix - didn't know you could get the sensor view like that. BTW, do you know much about prearm conditions on collision prevention - got a bug PX4/PX4-Autopilot#22994 and from my comment to that you can see a linked (current) discussion board post.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

puh, for Collision Prevention, i think you just have to have a obstacle_distance message present. but in the issue he's talking about avoidance, and there its handeled differently from what i know. as it has to wait for the onbaord computer to be ready

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, we should probably document that :-). So to be clear, the implication is that you need a component that is sending a HEARTBEAT and has type https://mavlink.io/en/messages/common.html#MAV_TYPE_ONBOARD_CONTROLLER right?

Copy link
Collaborator

@hamishwillee hamishwillee Aug 8, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ignore that, I can see the code

			case MAV_COMP_ID_OBSTACLE_AVOIDANCE:
				_heartbeat_component_obstacle_avoidance = now;
				_mavlink->telemetry_status().avoidance_system_healthy = (hb.system_status == MAV_STATE_ACTIVE);
				break;

Incorrect in that it relies on the companion computer component ID rather than mavlink type

Anyway, added a docs fix in #3340 to make it easier for people to search on the arm failure and find this information.,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants